﻿using CPPEI.Coolzon.DesignServer.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.DesignServer
{
    [ServiceContract]
    public interface IDesignService
    {
        /// <summary>
        /// 登录
        /// </summary>
        [OperationContract]
        SingleResult<User> Login(LoginRequest request);

        /// <summary>
        /// 创建工作空间
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [OperationContract]
        SingleResult<Workspace> CreateWorkspace(CreateWorkspaceRequest request);

        /// <summary>
        /// 获取工作空间列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [OperationContract]
        ListResult<Workspace> GetWorkspaceList(GetWorkspaceListRequest request);

        [OperationContract]
        SingleResult<Solution> CreateSolution(CreateSolutionRequest request);

        /// <summary>
        /// 获取工作空间列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [OperationContract]
        ListResult<Solution> GetSolutionList(GetSolutionListRequest request);

        /// <summary>
        /// 获取方案中的项目概要信息列表，用于在获取最新方案的时候提供给客户端比较
        /// </summary>
        /// <param name="token"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        [OperationContract]
        ListResult<ItemSummary> GetSolutionItemSummaries(GetItemSummaryListRequest request);

        [OperationContract]
        GetLatestVersionResponse GetLatestVersion(GetLatestVersionRequest request);

        [OperationContract]
        CheckInResponse CheckIn(CheckInRequest reqeust);

        [OperationContract]
        ServiceResult CheckOut(CheckOutRequest reqeust);

        [OperationContract]
        ServiceResult Delete(DeleteRequest reqeust);

        [OperationContract]
        UndoResponse Undo(UndoRequest request);

        [OperationContract]
        ListResult<DeletingList> GetDeletingList(DeleteRequest request);

        [OperationContract]
        Data.ServiceResult CreateDataSource(CreateDataSourceRequest request);

        [OperationContract]
        Data.ServiceResult CreateDataSet(CreateDataSetRequest request);

        [OperationContract]
        Data.ServiceResult UpdateDataSource(Data.CreateDataSourceRequest request);

        [OperationContract]
        ServiceResult UpdateDataSet(CreateDataSetRequest request);

        [OperationContract]
        ListResult<DataSource> GetDataSourceList(GetDataSourceListRequest request);

        [OperationContract]
        ListResult<DataSet> GetDataSetList(GetDataSetListRequest request);

        [OperationContract]
        ServiceResult DeleteDataSource(DeleteDataSourceRequest request);

        [OperationContract]
        ServiceResult DeleteDataSet(DeleteDataSetRequest request);

        [OperationContract]
        ServiceResult PublishDataSource(PublishDataSourceRequest request);

        [OperationContract]
        ListResult<PublishedDataSource> GetPublishedDataSources(GetPublishedDataSourceListRequest request);

        [OperationContract]
        ListResult<ItemHistory> GetItemHistoryList(GetItemHistoryListRequest request);

        [OperationContract]
        GetItemSpecificVersionResponse GetItemSpecificVersion(Data.GetItemSpecificVersionRequest request);

        [OperationContract]
        ListResult<ItemStatus> GetItemChildrenStatus(GetLatestStatusRequest request);

        [OperationContract]
        Data.ServiceResult DeleteSolutionItem(DeleteSolutionItemRequest request);

        [OperationContract]
        ListResult<ItemHistory> GetSolutionItemListSV(GetSolutionItemListSVRequest request);
    }
}
